﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.IO;
using System.IO.IsolatedStorage;
using System.Linq;
using System.Text;
using System.Threading;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Threading;
using Microsoft.Live;

namespace ShareFolder
{
    public class GClass4
    {

        private sealed class Class8
        {
            public GClass4 gclass4_0;
            public string string_0;
            public void method_0()
            {
                this.gclass4_0.method_9().Text = (this.string_0);
            }
        }

        private sealed class Class9
        {
            public bool bool_0;
            public GClass4 gclass4_0;
            public string string_0;
        }

        private sealed class Class10
        {
            public GClass4.Class9 class9_0;
            public GClass1 gclass1_0;
            public void method_0()
            {
                if (MessageBox.Show(string.Concat(new string[]
			{
				"File ",
				this.class9_0.string_0,
				"\\",
				this.gclass1_0.FileName,
				" exists. Overwrite?"
			}), "File exists", (MessageBoxButton)1) == (MessageBoxResult)1)
                {
                    this.class9_0.bool_0 = true;
                }
                this.class9_0.gclass4_0.autoResetEvent_0.Set();
            }
        }

        private sealed class Class11
        {
            public GClass4.Class9 class9_0;
            public GClass1 gclass1_0;
            public bool method_0(aw aw_0)
            {
                return aw_0.b && aw_0.a.ToUpper() == this.gclass1_0.FileName.ToUpper();
            }
        }
        private BackgroundWorker backgroundWorker_0;
        private GClass0 gclass0_0;
        private aa aa_0;
        private IsolatedStorageFile isolatedStorageFile_0;
        private string string_0;
        private string string_1;
        private AutoResetEvent autoResetEvent_0 = new AutoResetEvent(false);
        private string string_2;
        private string string_3;
        private int int_0;
        private GClass5 gclass5_0;

        private string string_4;

        private Dispatcher dispatcher_0;

        private GEnum0 genum0_0;

        private LiveConnectSession liveConnectSession_0;

        private TextBlock textBlock_0;

        private static Func<GClass1, bool> func_0;

        private static Func<GClass1, bool> func_1;

        private static Func<aw, bool> func_2;

        public string method_0()
        {
            return this.string_4;
        }

        public void method_1(string string_5)
        {
            this.string_4 = string_5;
        }

        public Dispatcher method_2()
        {
            return this.dispatcher_0;
        }

        public void method_3(Dispatcher dispatcher_1)
        {
            this.dispatcher_0 = dispatcher_1;
        }

        public GEnum0 method_4()
        {
            return this.genum0_0;
        }

        public void method_5(GEnum0 genum0_1)
        {
            this.genum0_0 = genum0_1;
        }

        public LiveConnectSession method_6()
        {
            return this.liveConnectSession_0;
        }

        public void method_7(LiveConnectSession liveConnectSession_1)
        {
            this.liveConnectSession_0 = liveConnectSession_1;
        }
        public BackgroundWorker method_8()
        {
            return this.backgroundWorker_0;
        }

        public TextBlock method_9()
        {
            return this.textBlock_0;
        }

        public void method_10(TextBlock textBlock_1)
        {
            this.textBlock_0 = textBlock_1;
        }
        public GClass4(GClass0 gclass0_1, aa aa_1, string string_5, IsolatedStorageFile isolatedStorageFile_1, string string_6)
        {
            this.backgroundWorker_0 = new BackgroundWorker();
            this.backgroundWorker_0.WorkerReportsProgress=(true);
            this.backgroundWorker_0.WorkerSupportsCancellation=(true);
            this.gclass0_0 = gclass0_1;
            this.isolatedStorageFile_0 = isolatedStorageFile_1;
            this.string_0 = string_5;
            this.aa_0 = aa_1;
            this.string_1 = string_6;
            this.backgroundWorker_0.DoWork+=(new DoWorkEventHandler(this.backgroundWorker_0_DoWork));
        }
        public void method_11()
        {
            this.backgroundWorker_0.RunWorkerAsync();
        }
        public void method_12()
        {
            this.backgroundWorker_0.CancelAsync();
            if (this.gclass5_0 != null)
            {
                this.gclass5_0.method_8();
            }
        }
        private Stream method_13(GEnum0 genum0_1, string string_5, ushort ushort_0, bool bool_0)
        {
            Stream result = null;
            switch (genum0_1)
            {
                case GEnum0.const_0:
                    result = new ab(this.aa_0, ushort_0, string_5, bool_0 ? (ushort)1 : (ushort)0);
                    break;
                case GEnum0.const_1:
                    //result = this.isolatedStorageFile_0.OpenFile(string_5, bool_0 ? 2 : 3);
                    result = this.isolatedStorageFile_0.OpenFile(string_5, bool_0 ? (FileMode)2 : (FileMode)3);
                    break;
            }
            return result;
        }
        private bool method_14(GEnum0 genum0_1, string string_5, ushort ushort_0)
        {
            bool result = false;
            switch (genum0_1)
            {
                case GEnum0.const_0:
                    result = this.aa_0.j(ushort_0, string_5);
                    break;
                case GEnum0.const_1:
                    result = this.isolatedStorageFile_0.FileExists(string_5);
                    break;
            }
            return result;
        }
        private void method_15(string string_5)
        {
            GClass4.Class8 @class = new GClass4.Class8();
            @class.string_0 = string_5;
            @class.gclass4_0 = this;
            this.method_2().BeginInvoke(new Action(@class.method_0));
        }
        private void method_16(List<GClass1> list_0, GEnum0 genum0_1, GEnum0 genum0_2, string string_5, BackgroundWorker backgroundWorker_1, DoWorkEventArgs doWorkEventArgs_0)
        {
            //GClass4.Class9 @class = new GClass4.Class9();
            //@class.string_0 = string_5;
            //@class.gclass4_0 = this;
            //byte[] array = new byte[65535];
            //ushort num = 0;
            //@class.bool_0 = false;
            //if (GClass4.func_0 == null)
            //{
            //    GClass4.func_0 = new Func<GClass1, bool>(GClass4.smethod_0);
            //}
            //IEnumerable<GClass1> enumerable = Enumerable.Where<GClass1>(list_0, GClass4.func_0);
            //if (GClass4.func_1 == null)
            //{
            //    GClass4.func_1 = new Func<GClass1, bool>(GClass4.smethod_1);
            //}
            //IEnumerable<GClass1> enumerable2 = Enumerable.Where<GClass1>(list_0, GClass4.func_1);
            //if (genum0_1 == GEnum0.const_0 || genum0_2 == GEnum0.const_0)
            //{
            //    num = this.aa_0.i(this.string_0);
            //}
            //using (IEnumerator<GClass1> enumerator = enumerable.GetEnumerator())
            //{
            //    Action action = null;
            //    GClass4.Class10 class2 = new GClass4.Class10();
            //    class2.class9_0 = @class;
            //    while (enumerator.MoveNext())
            //    {
            //        class2.gclass1_0 = enumerator.Current;
            //        if (genum0_1 != GEnum0.const_2)
            //        {
            //            this.method_15("Copying file: " + class2.gclass1_0.FileName);
            //        }
            //        else
            //        {
            //            this.method_15("Downdloading file: " + class2.gclass1_0.FileName);
            //        }
            //        this.string_2 = class2.gclass1_0.Path + "\\" + class2.gclass1_0.FileName;
            //        this.int_0 = class2.gclass1_0.FileSize;
            //        if (genum0_1 == GEnum0.const_1)
            //        {
            //            this.string_2 = "content\\" + this.string_2;
            //        }
            //        switch (genum0_2)
            //        {
            //            case GEnum0.const_0:
            //                this.string_3 = @class.string_0 + "\\" + class2.gclass1_0.FileName;
            //                break;
            //            case GEnum0.const_1:
            //                if (!string.IsNullOrEmpty(@class.string_0))
            //                {
            //                    @class.string_0 = @class.string_0.Trim();
            //                }
            //                this.string_3 = "content\\" + @class.string_0 + "\\" + class2.gclass1_0.FileName;
            //                break;
            //            case GEnum0.const_2:
            //                this.string_3 = class2.gclass1_0.FileName;
            //                break;
            //        }
            //        @class.bool_0 = false;
            //        bool flag;
            //        if (flag = this.method_14(genum0_2, this.string_3, num))
            //        {
            //            Dispatcher arg_21E_0 = this.method_2();
            //            if (action == null)
            //            {
            //                action = new Action(class2.method_0);
            //            }
            //            arg_21E_0.BeginInvoke(action);
            //            this.autoResetEvent_0.WaitOne();
            //        }
            //        if (!flag || (flag && @class.bool_0))
            //        {
            //            if (genum0_1 != GEnum0.const_2)
            //            {
            //                if (genum0_2 != GEnum0.const_2)
            //                {
            //                    Stream stream = this.method_13(genum0_1, this.string_2, num, false);
            //                    Stream stream2 = this.method_13(genum0_2, this.string_3, num, true);
            //                    long num2 = 0L;
            //                    int num3;
            //                    while ((num3 = stream.Read(array, 0, array.Length)) > 0)
            //                    {
            //                        stream2.Write(array, 0, num3);
            //                        num2 += (long)num3;
            //                        long num4;
            //                        if (class2.gclass1_0.FileSize > 0)
            //                        {
            //                            num4 = num2 * 100L / (long)class2.gclass1_0.FileSize;
            //                        }
            //                        else
            //                        {
            //                            num4 = num2 * 100L / stream.Length;
            //                        }
            //                        backgroundWorker_1.ReportProgress((int)num4);
            //                        if (backgroundWorker_1.CancellationPending)
            //                        {
            //                            doWorkEventArgs_0.Cancel = true;
            //                        IL_2F7:
            //                            backgroundWorker_1.ReportProgress(0);
            //                            stream2.Dispose();
            //                            stream.Dispose();
            //                            goto IL_3A7;
            //                        }
            //                    }
            //                    goto IL_2F7;
            //                }
            //            }
            //            if (genum0_1 == GEnum0.const_2)
            //            {
            //                Stream stream2 = this.method_13(genum0_2, this.string_3, num, true);
            //                this.gclass5_0.method_16((class2.gclass1_0 as GClass2).Id + "/content", stream2);
            //                stream2.Dispose();
            //            }
            //            else
            //            {
            //                Stream stream = this.method_13(genum0_1, this.string_2, num, false);
            //                this.gclass5_0.method_13(@class.string_0, this.string_3, stream);
            //                stream.Dispose();
            //            }
            //            if (!string.IsNullOrEmpty(this.method_0()))
            //            {
            //                throw new Exception(this.method_0());
            //            }
            //            if (backgroundWorker_1.CancellationPending)
            //            {
            //                doWorkEventArgs_0.Cancel = (true);
            //            }
            //        }
            //    IL_3A7:
            //        if (doWorkEventArgs_0.Cancel)
            //        {
            //            break;
            //        }
            //    }
            //}
            //if (doWorkEventArgs_0.Cancel)
            //{
            //    if (genum0_2 == GEnum0.const_0)
            //    {
            //        this.method_18(num);
            //    }
            //    else
            //    {
            //        if (genum0_2 == GEnum0.const_1)
            //        {
            //            this.method_17();
            //        }
            //    }
            //}
            //else
            //{
            //    using (IEnumerator<GClass1> enumerator2 = enumerable2.GetEnumerator())
            //    {
            //        Func<aw, bool> func = null;
            //        GClass4.Class11 class3 = new GClass4.Class11();
            //        class3.class9_0 = @class;
            //        while (enumerator2.MoveNext())
            //        {
            //            class3.gclass1_0 = enumerator2.Current;
            //            if (genum0_2 == GEnum0.const_0)
            //            {
            //                IEnumerable<aw> arg_45F_0 = this.aa_0.i(this.string_0, @class.string_0);
            //                if (func == null)
            //                {
            //                    func = new Func<aw, bool>(class3.method_0);
            //                }
            //                if (Enumerable.SingleOrDefault<aw>(arg_45F_0, func) == null)
            //                {
            //                    this.method_15("Creating directory: " + class3.gclass1_0.FileName);
            //                    this.aa_0.h(num, @class.string_0 + "\\" + class3.gclass1_0.FileName);
            //                }
            //            }
            //            else
            //            {
            //                if (!this.isolatedStorageFile_0.DirectoryExists("content\\" + @class.string_0 + "\\" + class3.gclass1_0.FileName.Trim()))
            //                {
            //                    this.method_15("Creating directory: " + class3.gclass1_0.FileName);
            //                    this.isolatedStorageFile_0.CreateDirectory("content\\" + @class.string_0 + "\\" + class3.gclass1_0.FileName.Trim());
            //                }
            //            }
            //            List<GClass1> list = new List<GClass1>();
            //            if (genum0_1 == GEnum0.const_0)
            //            {
            //                List<aw> list2 = this.aa_0.i(this.string_0, class3.gclass1_0.Path + "\\" + class3.gclass1_0.FileName);
            //                IEnumerable<aw> arg_593_0 = list2;
            //                if (GClass4.func_2 == null)
            //                {
            //                    GClass4.func_2 = new Func<aw, bool>(GClass4.smethod_2);
            //                }
            //                using (IEnumerator<aw> enumerator3 = Enumerable.Where<aw>(arg_593_0, GClass4.func_2).GetEnumerator())
            //                {
            //                    while (enumerator3.MoveNext())
            //                    {
            //                        aw current = enumerator3.Current;
            //                        list.Add(new GClass1
            //                        {
            //                            FileName = current.a,
            //                            Path = class3.gclass1_0.Path + "\\" + class3.gclass1_0.FileName,
            //                            FileSize = current.c,
            //                            IsDirectory = current.b
            //                        });
            //                    }
            //                    goto IL_79E;
            //                }
            //                goto IL_628;
            //            }
            //            goto IL_628;
            //        IL_79E:
            //            if (!doWorkEventArgs_0.Cancel)
            //            {
            //                if (!string.IsNullOrEmpty(@class.string_0))
            //                {
            //                    GClass4.Class9 expr_7B5 = @class;
            //                    expr_7B5.string_0 += "\\";
            //                }
            //                this.method_16(list, genum0_1, genum0_2, @class.string_0 + class3.gclass1_0.FileName, backgroundWorker_1, doWorkEventArgs_0);
            //                continue;
            //            }
            //            break;
            //        IL_628:
            //            string[] directoryNames = this.isolatedStorageFile_0.GetDirectoryNames(string.Concat(new string[]
            //        {
            //            "content\\",
            //            class3.gclass1_0.Path,
            //            "\\",
            //            class3.gclass1_0.FileName,
            //            "\\*"
            //        }));
            //            for (int i = 0; i < directoryNames.Length; i++)
            //            {
            //                string fileName = directoryNames[i];
            //                list.Add(new GClass1
            //                {
            //                    FileName = fileName,
            //                    Path = class3.gclass1_0.Path + "\\" + class3.gclass1_0.FileName,
            //                    IsDirectory = true
            //                });
            //            }
            //            string[] fileNames = this.isolatedStorageFile_0.GetFileNames(string.Concat(new string[]
            //        {
            //            "content\\",
            //            class3.gclass1_0.Path,
            //            "\\",
            //            class3.gclass1_0.FileName,
            //            "\\*"
            //        }));
            //            for (int j = 0; j < fileNames.Length; j++)
            //            {
            //                string fileName2 = fileNames[j];
            //                list.Add(new GClass1
            //                {
            //                    FileName = fileName2,
            //                    Path = class3.gclass1_0.Path + "\\" + class3.gclass1_0.FileName,
            //                    IsDirectory = false
            //                });
            //            }
            //            goto IL_79E;
            //        }
            //    }
            //}
            //if (num != 0)
            //{
            //    this.aa_0.h(num);
            //}
            Stream stream;
            long num;
            Stream stream1;
            string string5 = string_5;
            byte[] numArray = new byte[65535];
            ushort num1 = 0;
            bool flag = false;
            bool flag1 = false;
            IEnumerable<GClass1> list0 =
                from gclass1_0 in list_0
                where !gclass1_0.IsDirectory
                select gclass1_0;
            IEnumerable<GClass1> gClass1s =
                from gclass1_0 in list_0
                where gclass1_0.IsDirectory
                select gclass1_0;
            if (genum0_1 == GEnum0.const_0 || genum0_2 == GEnum0.const_0)
            {
                num1 = this.aa_0.i(this.string_0);
            }
            using (IEnumerator<GClass1> enumerator = list0.GetEnumerator())
            {
                do
                {
                    if (enumerator.MoveNext())
                    {
                        GClass1 current = enumerator.Current;
                        if (genum0_1 == GEnum0.const_2)
                        {
                            this.method_15(string.Concat("Downdloading file: ", current.FileName));
                        }
                        else
                        {
                            this.method_15(string.Concat("Copying file: ", current.FileName));
                        }
                        this.string_2 = string.Concat(current.Path, "\\", current.FileName);
                        this.int_0 = current.FileSize;
                        if (genum0_1 == GEnum0.const_1)
                        {
                            this.string_2 = string.Concat("content\\", this.string_2);
                        }
                        switch (genum0_2)
                        {
                            case GEnum0.const_0:
                                {
                                    this.string_3 = string.Concat(string5, "\\", current.FileName);
                                    break;
                                }
                            case GEnum0.const_1:
                                {
                                    if (!string.IsNullOrEmpty(string5))
                                    {
                                        string5 = string5.Trim();
                                    }
                                    this.string_3 = string.Concat("content\\", string5, "\\", current.FileName);
                                    break;
                                }
                            case GEnum0.const_2:
                                {
                                    this.string_3 = current.FileName;
                                    break;
                                }
                        }
                        flag1 = false;
                        bool flag2 = this.method_14(genum0_2, this.string_3, num1);
                        flag = flag2;
                        if (flag2)
                        {
                            this.method_2().BeginInvoke(() =>
                            {
                                if (MessageBox.Show(string.Concat(new string[] { "File ", string5, "\\", current.FileName, " exists. Overwrite?" }), "File exists", MessageBoxButton.OKCancel) == MessageBoxResult.OK)
                                {
                                    flag1 = true;
                                }
                                this.autoResetEvent_0.Set();
                            });
                            this.autoResetEvent_0.WaitOne();
                        }
                        if (flag && (!flag || !flag1))
                        {
                            continue;
                        }
                        if (genum0_1 != GEnum0.const_2)
                        {
                            if (genum0_2 != GEnum0.const_2)
                            {
                                stream1 = this.method_13(genum0_1, this.string_2, num1, false);
                                stream = this.method_13(genum0_2, this.string_3, num1, true);
                                long num2 = (long)0;
                                while (true)
                                {
                                    int num3 = stream1.Read(numArray, 0, (int)numArray.Length);
                                    int num4 = num3;
                                    if (num3 > 0)
                                    {
                                        stream.Write(numArray, 0, num4);
                                        num2 = num2 + (long)num4;
                                        num = (current.FileSize <= 0 ? num2 * (long)100 / stream1.Length : num2 * (long)100 / (long)current.FileSize);
                                        backgroundWorker_1.ReportProgress((int)num);
                                        if (backgroundWorker_1.CancellationPending)
                                        {
                                            doWorkEventArgs_0.Cancel = true;
                                            break;
                                        }
                                    }
                                    else
                                    {
                                        break;
                                    }
                                }
                                backgroundWorker_1.ReportProgress(0);
                                stream.Dispose();
                                stream1.Dispose();
                                continue;
                            }
                        }
                        if (genum0_1 != GEnum0.const_2)
                        {
                            stream1 = this.method_13(genum0_1, this.string_2, num1, false);
                            this.gclass5_0.method_13(string5, this.string_3, stream1);
                            stream1.Dispose();
                        }
                        else
                        {
                            stream = this.method_13(genum0_2, this.string_3, num1, true);
                            this.gclass5_0.method_16(string.Concat((current as GClass2).Id, "/content"), stream);
                            stream.Dispose();
                        }
                        if (!string.IsNullOrEmpty(this.method_0()))
                        {
                            throw new Exception(this.method_0());
                        }
                        if (!backgroundWorker_1.CancellationPending)
                        {
                            continue;
                        }
                        doWorkEventArgs_0.Cancel = true;
                    }
                    else
                    {
                        break;
                    }
                }
                while (!doWorkEventArgs_0.Cancel);
            }
            if (!doWorkEventArgs_0.Cancel)
            {
                foreach (GClass1 gClass1 in gClass1s)
                {
                    if (genum0_2 == GEnum0.const_0)
                    {
                        if (this.aa_0.i(this.string_0, string5).SingleOrDefault<aw>((aw aw_0) =>
                        {
                            if (!aw_0.b)
                            {
                                return false;
                            }
                            return aw_0.a.ToUpper() == gClass1.FileName.ToUpper();
                        }) == null)
                        {
                            this.method_15(string.Concat("Creating directory: ", gClass1.FileName));
                            this.aa_0.h(num1, string.Concat(string5, "\\", gClass1.FileName));
                        }
                    }
                    else if (!this.isolatedStorageFile_0.DirectoryExists(string.Concat("content\\", string5, "\\", gClass1.FileName.Trim())))
                    {
                        this.method_15(string.Concat("Creating directory: ", gClass1.FileName));
                        this.isolatedStorageFile_0.CreateDirectory(string.Concat("content\\", string5, "\\", gClass1.FileName.Trim()));
                    }
                    List<GClass1> gClass1s1 = new List<GClass1>();
                    if (genum0_1 != GEnum0.const_0)
                    {
                        IsolatedStorageFile isolatedStorageFile0 = this.isolatedStorageFile_0;
                        string[] path = new string[] { "content\\", gClass1.Path, "\\", gClass1.FileName, "\\*" };
                        string[] directoryNames = isolatedStorageFile0.GetDirectoryNames(string.Concat(path));
                        for (int i = 0; i < (int)directoryNames.Length; i++)
                        {
                            string str = directoryNames[i];
                            GClass1 gClass11 = new GClass1()
                            {
                                FileName = str,
                                Path = string.Concat(gClass1.Path, "\\", gClass1.FileName),
                                IsDirectory = true
                            };
                            gClass1s1.Add(gClass11);
                        }
                        IsolatedStorageFile isolatedStorageFile = this.isolatedStorageFile_0;
                        string[] strArrays = new string[] { "content\\", gClass1.Path, "\\", gClass1.FileName, "\\*" };
                        string[] fileNames = isolatedStorageFile.GetFileNames(string.Concat(strArrays));
                        for (int j = 0; j < (int)fileNames.Length; j++)
                        {
                            string str1 = fileNames[j];
                            GClass1 gClass12 = new GClass1()
                            {
                                FileName = str1,
                                Path = string.Concat(gClass1.Path, "\\", gClass1.FileName),
                                IsDirectory = false
                            };
                            gClass1s1.Add(gClass12);
                        }
                    }
                    else
                    {
                        List<aw> aws = this.aa_0.i(this.string_0, string.Concat(gClass1.Path, "\\", gClass1.FileName));
                        foreach (aw _aw in aws.Where<aw>((aw aw_0) =>
                        {
                            if (aw_0.a == ".")
                            {
                                return false;
                            }
                            return aw_0.a != "..";
                        }))
                        {
                            GClass1 gClass13 = new GClass1()
                            {
                                FileName = _aw.a,
                                Path = string.Concat(gClass1.Path, "\\", gClass1.FileName),
                                FileSize = _aw.c,
                                IsDirectory = _aw.b
                            };
                            gClass1s1.Add(gClass13);
                        }
                    }
                    if (doWorkEventArgs_0.Cancel)
                    {
                        break;
                    }
                    if (!string.IsNullOrEmpty(string5))
                    {
                        string5 = string.Concat(string5, "\\");
                    }
                    this.method_16(gClass1s1, genum0_1, genum0_2, string.Concat(string5, gClass1.FileName), backgroundWorker_1, doWorkEventArgs_0);
                }
            }
            else if (genum0_2 == GEnum0.const_0)
            {
                this.method_18(num1);
            }
            else if (genum0_2 == GEnum0.const_1)
            {
                this.method_17();
            }
            if (num1 != 0)
            {
                this.aa_0.h(num1);
            }
        }
        private void backgroundWorker_0_DoWork(object sender, DoWorkEventArgs e)
        {
            try
            {
                if (this.gclass0_0.method_0() == GEnum0.const_2 || this.method_4() == GEnum0.const_2)
                {
                    this.gclass5_0 = new GClass5(this.method_6());
                    this.gclass5_0.method_7().DownloadProgressChanged += new EventHandler<LiveDownloadProgressChangedEventArgs>(this.method_20);
                    this.gclass5_0.method_7().UploadProgressChanged += new EventHandler<LiveUploadProgressChangedEventArgs>(this.method_19);
                }
                this.method_16(this.gclass0_0.method_4(), this.gclass0_0.method_0(), this.method_4(), this.string_1, sender as BackgroundWorker, e);
            }
            catch (Exception ex)
            {
                this.method_1(ex.Message);
                if (this.method_4() == GEnum0.const_1)
                {
                    this.method_17();
                }
                throw ex;
            }
        }
        private void method_17()
        {
            if (this.isolatedStorageFile_0.FileExists(this.string_3))
            {
                this.isolatedStorageFile_0.DeleteFile(this.string_3);
            }
        }
        private void method_18(ushort ushort_0)
        {
            this.aa_0.i(ushort_0, this.string_3);
        }
        private void method_19(object sender, LiveUploadProgressChangedEventArgs e)
        {
            if (this.backgroundWorker_0.IsBusy)
            {
                this.backgroundWorker_0.ReportProgress((int)e.BytesSent * 100 / this.int_0);
            }
        }
        private void method_20(object sender, LiveDownloadProgressChangedEventArgs e)
        {
            if (this.backgroundWorker_0.IsBusy)
            {
                this.backgroundWorker_0.ReportProgress(e.ProgressPercentage);
            }
        }

        private static bool smethod_0(GClass1 gclass1_0)
        {
            return !gclass1_0.IsDirectory;
        }

        private static bool smethod_1(GClass1 gclass1_0)
        {
            return gclass1_0.IsDirectory;
        }

        private static bool smethod_2(aw aw_0)
        {
            return aw_0.a != "." && aw_0.a != "..";
        }
    }
}
